package demo.dag;

import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.util.Preconditions;

abstract class TransformationDemo<T> {
    protected TypeInformation<T> outputType;
    protected final int id;
    protected String name;
    private int parallelism;
    private String slotSharingGroup;

    protected static Integer idCounter = 0;

    public TransformationDemo(String name, TypeInformation<T> outputType, int parallelism) {
        this.id = getNewNodeId();
        this.name = Preconditions.checkNotNull(name);
        this.outputType = outputType;
        this.parallelism = parallelism;
        this.slotSharingGroup = null;
    }

    public static int getNewNodeId() {
        idCounter++;
        return idCounter;
    }



    public TypeInformation<T> getOutputType() {
        return outputType;
    }

    public void setOutputType(TypeInformation<T> outputType) {
        this.outputType = outputType;
    }
}
